package com.tjhzzx.hnceCore2024.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @version 1.0
 * @date 2022-08-24 10:34
 */
public final class BHistoryLineType extends BFrozenEnum {
    public static final int DAILY = 0;
    public static final int MONTHLY = 1;
    public static final int YEARLY = 2;
    public static final int WEEKLY = 3;

    public static final BHistoryLineType daily = new BHistoryLineType(0);
    public static final BHistoryLineType monthly = new BHistoryLineType(1);
    public static final BHistoryLineType yearly = new BHistoryLineType(2);
    public static final BHistoryLineType weekly = new BHistoryLineType(3);

    public static final BHistoryLineType DEFAULT = daily;

    public BHistoryLineType(int ordinal) {
        super(ordinal);
    }

    public static BHistoryLineType make(int ordinal) {
        return (BHistoryLineType) daily.getRange().get(ordinal, false);
    }

    public static BHistoryLineType make(String tag) {
        return (BHistoryLineType) daily.getRange().get(tag);
    }

    public static String expose() {
        return "{\"DAILY\":0, \"MONTHLY\":1, \"YEARLY\":2, \"WEEKLY\":3}";
    }


    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BHistoryLineType.class);
}
